#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <cstdio>
#include <stdlib.h>
#include <stack>
#include <numeric>
typedef long long ll;
#define MAX 20
using namespace std;
int n,m,k;
#define INF 2147483647
#define G 9.8
bool debug = false;
int main()
{
scanf("%d%d%d", &n,&m,&k);
int a,b;
bool bl = false;
for (int i=0;i<k;i++) {
scanf("%d%d", &a, &b);
if (a<=5 || n-a<5 || b<=5 || m-b<5) {bl=true; break;}
}
puts(bl?"YES":"NO");
return 0;
}
Differences of the permutations | Doctor's Secret |
Back to School | I am Easy |
Teddy and Tweety | Partitioning binary strings |
Special sets | Smallest chosen word |
Going to office | Color the boxes |
Missing numbers | Maximum sum |
13 Reasons Why | Friend's Relationship |
Health of a person | Divisibility |
A. Movement | Numbers in a matrix |
Sequences | Split houses |
Divisible | Three primes |
Coprimes | Cost of balloons |
One String No Trouble | Help Jarvis! |
Lift queries | Goki and his breakup |
Ali and Helping innocent people | Book of Potion making |